< previous page page_436 next page >

Page 436
0436-01.jpg
Figure 11.11.
A graph of book sales data by sales rep.
Adding More Properties to the DataGraph Object
Now that the basic DataGraph object is working, let's add some of the bells and whistles that make this a versatile programming tool. Let's add four new properties to the class:
· LegendField: This is the Recordset column to use for setting the legends of the graph.
· LabelField: This is the Recordset column to use for setting the labels of the graph.
· LeftTitle: This is the string to display as the title on the left side of the graph.
· BottomTitle: This is the string to display as the title at the bottom of the graph.
In order to add these new features, all you need to do is add the property definitions to the DataGraph object and then add code to the ShowGraph method to incorporate these new properties into the displayed graph.
The code in Listing 11.21 shows the changes you need to make to the general declaration section of the DataGraph class. The four new variables are added at the end of the section.
Type.gifListing 11.21. Adding local storage variables for the new properties.
Option Explicit

'
' enumerated graph types
'
Enum dgType
    dgPie3d = gphPie3D
    dgBar3d = gphBar3D

 
< previous page page_436 next page >

If you like this book, buy it!